Perform clean boot and see if it shuts down successfully when in that state. Log on to the computer by using an account that has administrator rights. Click Start, type msconfig.exe in the Start Search box, and then press ENTER to start the System Configu
There’s a bug that was discovered in 2020 that causes windows 7 to not shut down, try doing a system restore and restore your pc to the point before the issue started happening